Skip to content

fix: resolve type errors and Pydantic failures from codegen overwrites#2703

Open
musa-cf wants to merge 1 commit intonextfrom
fix/codegen-type-errors
Open

fix: resolve type errors and Pydantic failures from codegen overwrites#2703
musa-cf wants to merge 1 commit intonextfrom
fix/codegen-type-errors

Conversation

@musa-cf
Copy link
Copy Markdown
Contributor

@musa-cf musa-cf commented Apr 24, 2026

Summary

  • ai/finetunes/asset_create_params: restore missing Required import dropped by codegen
  • organizations/organization_profile + test: inline Result type alias after codegen deleted organization_profile_get_params.py
  • ai/to_markdown, radar/ai/to_markdown: add # type: ignore[call-arg] on _get_api_list() call site for mypy; keep # pyright: ignore on files= kwarg
  • pipelines params (sink_create_params, stream_create_params): restore TypedDict base class on SchemaFieldStruct/SchemaFieldList with object for recursive field refs
  • pipelines responses (6 files): add BaseModel base class, type discriminator field, and standard fields to SchemaFieldStruct/SchemaFieldList stubs with object for recursive refs

Context

All issues stem from the April 19-23 codegen runs (3b83baa3b, 0d6464258, 988df8632) overwriting earlier manual fixes (1c415a2dd, f280942f4). The pipelines recursive types use object instead of forward-referencing "SchemaField" to avoid Pydantic v2 PydanticSchemaGenerationError at module import time.

Validation

pyright  -> 0 errors (was 55)
mypy     -> 0 errors (was 12)
ruff     -> pass
pytest   -> 39,931 passed, 14,255 skipped, 0 errors
             (was 51 failed + 36 errors before fix)

Remaining test failures (dns.records scan_list/scan_review, workers.beta.workers create/update) are mock server issues addressed in a separate cloudflare-config skip PR: https://gitlab.cfdata.org/cloudflare/sdks/cloudflare-config/-/merge_requests/730

- asset_create_params: restore missing Required import
- organization_profile: inline Result type alias from deleted module
- ai/to_markdown: add type-checker suppression for files kwarg in
  _get_api_list; fix mypy comment placement on call site
- radar/ai/to_markdown: fix mypy comment placement on call site
- pipelines params (sink_create_params, stream_create_params): restore
  TypedDict base class on SchemaFieldStruct/SchemaFieldList with object
  for recursive field refs to avoid Pydantic schema generation errors
- pipelines responses (6 files): add BaseModel base class, type
  discriminator, and standard fields to SchemaFieldStruct/SchemaFieldList
  stubs with object for recursive refs

All fixes address codegen overwrites of manual patches from earlier
commits (1c415a2, f280942).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant